package com.hsp_java.collection_;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionFor {
    public static void main(String[] args) {

        Collection col = new ArrayList();
        col.add(new Book("雾都孤儿", "狄更斯", 55.5));
        col.add(new Book("大卫科波菲尔", "狄更斯", 55.5));
        col.add(new Book("双城记", "狄更斯", 55.5));

        //增强for本质是调用迭代器
        for (Object book : col) {
            System.out.println(book);
        }

        //快捷键是 I
        for (Object o : col) {
            System.out.println(o);
        }


    }
}


//class Book_ {
//    private String name;
//    private String author;
//    private double price;
//
//    public Book_(String name, String author, double price) {
//        this.name = name;
//        this.author = author;
//        this.price = price;
//    }
//
//
//
//}
